<template>
  <div
    class="res-info"
  >
    <div
      v-if="infoType === '1'"
      class="header"
    >
      <ShowMessage
        ref="resmessage"
        :message="message"
      />
    </div>
    <!-- <div
      v-if="infoType === '1'"
      class="content"
    >
      <ShowPicture
        :plan-id="planId"
        :open-card="openCard"
        :infodata="infodata"
        :useraccount="useraccount"
      />
    </div> -->
    <!-- <div
      v-if="infoType === '2'"
      class="header"
    >
      <ShowAudit
        ref="showAudit"
        :audit-data="auditData"
        :check="check"
        :plan-id="planId"
        :useraccount="useraccount"
        :active-id="activeId"
        :active-name="activeName"
        @closed="close"
      />
    </div> -->
    <!-- <div class="footer">
      <ShowCheck
        :info-type="infoType"
        :check="check"
        :plan-id="planId"
        :infodata="infodata"
        :useraccount="useraccount"
        :active-id="activeId"
        :active-name="activeName"
        @submit-success="success"
        @all-audit="showAudit"
      />
    </div> -->
  </div>
</template>

<script>

// import ShowPicture from './components/ShowPicture.vue';
import ShowMessage from './components/ShowMessage.vue';
// import ShowCheck from './components/ShowCheck.vue';
// import ShowAudit from './components/ShowAudit.vue';

export default {
  name: 'ResInfo',
  components: {
    ShowMessage,
    // ShowPicture,
    // ShowCheck,
    // ShowAudit,
  },
  props: {
    infodata: {
      type: Object,
      default: () => {},
    },
    openCard: {
      type: Boolean,
      default: false,
    },
    planId: {
      type: String,
      default: '',
    },
    companyid: {
      type: String,
      default: '',
    },
    resultData: {
      type: Object,
      default: () => {},
    },
    auditData: {
      type: Array,
      default: () => [],
    },
    activeId: {
      type: String,
      default: '',
    },
    activeName: {
      type: String,
      default: '',
    },
    useraccount: {
      type: String,
      default: '',
    },
    infoType: {
      type: String,
      default: '1',
    },
  },
  data() {
    return {
      check: {},
      pictures: [],
      message: {
        type: Object,
      },
    };
  },
  watch: {
    resultData() {
      this.initData();
    },
  },
  mounted() {
    if (this.infoType === '1') {
      this.initData();
    }
  },
  methods: {
    // 初始化数据
    initData() {
      const that = this;
      that.message = that.resultData.info;
      that.check = that.resultData.check;
    },
    close() {
      this.$emit('closed');
    },
    success(id, isCheck) {
      this.$emit('success-submit', id, isCheck);
    },
    getcheck(id, isCheck) {
      this.$emit('getcheck', id, isCheck);
    },
    // 获取批量审批数据
    showAudit(isCheck) {
      this.$refs.showAudit.getAllSelect(isCheck);
    },
    // 清除计算经纬度选择
    clearSelectInfo() {
      this.$refs.resmessage.clearSelect();
    },
  },
};
</script>

<style lang="scss" scoped>
  .res-info {
    .header {
    }
    .content {
      height: 80px;
    }
    .footer {
      height: 216px;
    }
  }

</style>
